// dashboard.api.ts
import request from '@/utils/request'
import type { DashboardDTO } from "@/views/dashboard/types";

// 获取仪表盘数据
export function getDashboardData(params: {
  dateRange?: [string, string]
  timeType?: 'month' | 'year'
}): Promise<{ data: DashboardDTO }> {
  return request({
    url: '/dashboard/data',
    method: 'get',
    params: {
      startDate: params.dateRange?.[0],
      endDate: params.dateRange?.[1],
      timeType: params.timeType
    }
  })
}